<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
<link href="css/pagination.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>品类管理</title>
</head>
<body>

	<nav class="breadcrumb">
			<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 商品中心 <span class="c-gray en">&gt;</span> 品类管理 
			
			<a class="btn btn-refresh btn-success radius r mr-20" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" onclick="javascript:location.replace(location.href);" >刷新</a>
			<a class="btn btn-primary radius r mr-10 mt-5" onclick="type_add('添加品类','<%=path%>/backstage/type-add-pre2')" href="javascript:;"><i class="Hui-iconfont"></i> 添加品类</a>
	</nav>
	<div class="pd-20">
		<div class="cl pd-5 bg-1 bk-gray"> 
		<form action="<%=path%>/backstage/findbycnamezy" method="get" class="form form-horizontal" id="form-type-add">
			<label>品类名称：</label>
			<input type="text" class="input-text" style="width:250px" placeholder="" id="" name="cName2" value="${conditions.cName}"/>
			
			<label class="form-label col-1" style="width:120px">选择商品分类：</label>
			
			<div class="formControls col-2"> <span class="select-box">
				<select name="cGrade" class="select" id="select">
					<option value="" selected>大类</option>
					<c:forEach items="${typesOne}" var="type1">
						<c:if test="${type1.cMod=='品类'}">
							<option value="${type1.cCode}"
							<c:if test="${conditions.cGrade==type1.cCode}">selected</c:if>  
							<c:if test="${conditions.cGrade==0&&conditions.cBelong==type1.cCode}">selected</c:if>
							>${type1.cName}</option>
						</c:if>
					</c:forEach>
				</select>
				</span> 
			</div>
			
			<div class="formControls col-2"> <span class="select-box">
				<select name="cBelong" class="select" id="select-two">
					<option value="" selected>中类</option>
					<c:forEach items="${typesTwo}" var="type2">
					<option value="${type2.cCode}" <c:if test="${conditions.cBelong==type2.cCode}">selected</c:if>  > ${type2.cName} </option>
					</c:forEach>
				</select>
				</span> 
			</div>
			
			
			<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont"></i> 提交</button>
			<a class="btn btn-danger radius" onclick="type_reset('<%=path%>/backstage/type-list')" href="javascript:;"><i class="Hui-iconfont"></i> 重置</a>
			<a class="btn btn-danger radius" onclick="type_reset('<%=path%>/backstage/onlyBigType')" href="javascript:;"><i class="Hui-iconfont"></i>只看大类</a>
			
		</form>
		</div>
		<!-- <div class="cl pd-5 bg-1 bk-gray"> 
			<span class="l"> 
			</span>
			
		 </div> -->

		<div class="mt-20">
			<table
				class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
						<th width="40">ID</th>
						
						<th>小类</th>
						<th>中类</th>
						<th>大类</th>
						<th>来源</th>
						<th>更新时间</th>
						<th>更新人</th>
						<th>排序</th>
						<th>是否有效</th>
						<th width="100">操作</th>
					</tr>
				</thead>
				<tbody>
						<c:forEach items="${types}" var="type">		
						<tr class="text-c">
							<input type="hidden" id="cCode" name="cCode" value='${type.cCode}' />
							<td>${type.cCode}</td>
						   
							<c:if test="${type.cBelong==0&&type.cGrade==0}">
								<td>---</td>
								<td>---</td>
								<td>${type.cName}</td>
							</c:if>
							<c:if test="${type.cBelong==type.cGrade&&type.cGrade!=0}">
								<td>---</td>
								<td>
								${type.cName}
								</td>
								<td>
								<c:forEach items="${alltypes}" var="type2">
									<c:if test="${type2.cCode==type.cBelong}">
										${type2.cName}
									</c:if>
								</c:forEach>
								</td>
							</c:if>
							<c:if test="${type.cBelong!=type.cGrade&&type.cGrade!=0&&type.cBelong!=0}">
								<td>${type.cName}</td>
								<td>
								<c:forEach items="${alltypes}" var="type2">
									<c:if test="${type2.cCode==type.cBelong}">
										${type2.cName}
									</c:if>
								</c:forEach>
								</td>
								<td>
								<c:forEach items="${alltypes}" var="type2">
									<c:if test="${type2.cCode==type.cGrade}">
										${type2.cName}
									</c:if>
								</c:forEach>
								</td>
							</c:if>
							<td>${type.sources}</td>
							<td>${type.updatetime}</td>
							<td>${type.updateuser}</td>
							<td>${type.cSort}</td>
							<td>
							<c:choose>
								<c:when test="${1==type.cEnable}">
									<span class="label label-success radius">有效</span>
								</c:when>
								<c:otherwise>
									<span class="label label-warning radius">已删除</span>
								</c:otherwise>
							</c:choose>
							</td>
							<td class="td-manage">
								<a style="text-decoration:none"
								onClick="type_edit(this,'${type.cCode}')" href="javascript:;"
								title="编辑">编辑</a>
								&nbsp;&nbsp;&nbsp;&nbsp;
								
								<a style="text-decoration:none"
								onClick="type_disable(this,'${type.cCode}')" href="javascript:void(0);"
								title="删除">删除</a>
								
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
			<div id="Pagination" class="page-con"></div>
		</div>
	</div>
	<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="js/H-ui.js"></script>
	<script type="text/javascript" src="js/H-ui.admin.js"></script>
	<script type="text/javascript" src="js/jquery.pagination.js"></script>
	<script type="text/javascript">
	var showCount = ${pageInfo.showCount};
		var currentPage = ${pageInfo.currentPage-1};
		var totalResult = ${pageInfo.totalResult};
		var base_path = "<%=path%>";
	</script>
	<script type="text/javascript" src="js/type_list.js"></script>
</body>
</html>